package com.scenery.view;

import java.util.ArrayList;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ListView;


import com.scenery.R;
import com.scenery.adapter.CityAdapter;

import com.scenery.util.Loger;
import com.scenery.vo.City;
/***
 * 城市列表
 * **/
public class CityListView extends ListView {
	private static final String TAG = CityListView.class.getName();
	private CityAdapter adapter; 
	private ArrayList<City> list = new ArrayList<City>();
	public CityListView(Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
		adapter=new CityAdapter(context, R.layout.city_list_item, list); 
		setAdapter(adapter);
		//refresh( );
	}
	
	public void refresh( ArrayList<City> data){
		Loger.d(TAG, "refresh");
		list.clear();
		for(City bean:data){
			list.add(bean);
		}
		adapter.notifyDataSetChanged();
	}
}
